import type { RouteRecordRaw } from 'vue-router'

export const routes: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'layout',
    component: () => import('@/layout/Layout.vue'),
    redirect: '/home',
    meta: {
      title: 'layout',
      hidden: true,
    },
    children: [
      // 首页
      {
        path: '/home',
        name: 'home',
        component: () => import('@/views/home/index.vue'),
        meta: {
          title: '首页',
          hidden: false,
          icon: 'el-House',
        },
      },
      {
        path: '/screen',
        name: 'screen',
        component: () => import('@/views/screen/index.vue'),
        meta: {
          title: '数据大屏',
          hidden: false,
          icon: 'el-DataLine',
        },
      },
// 权限管理
      {
        path: '/permission',
        name: 'permission',
        component: () => import('@/layout/Layout.vue'),
        meta: {
          title: '权限管理',
          hidden: false,
          icon: 'el-Lock',
        },
        redirect:"/permission/role",
        children: [
          {
            path: '/permission/role',
            name: 'role',
            component: () => import('@/views/permission/role/index.vue'),
            meta: {
              title: '角色管理',
              hidden: false,
              icon: 'el-User',
            },
          },
          {
            path: '/permission/user',
            name: 'user',
            component: () => import('@/views/permission/user/index.vue'),
            meta: {
              title: '用户管理',
              hidden: false,
              icon: 'el-UserFilled',
            },
          },
          {
            path: '/permission/menu',
            name: 'menu',
            component: () => import('@/views/permission/menu/index.vue'),
            meta: {
              title: '菜单管理',
              hidden: false,
              icon: 'el-Monitor',
            },
          },
        ],
      },
      //商品管理
      {
        path: '/product',
        name: 'product',
        meta: {
          title: '商品管理',
          hidden: false,
          icon: 'el-Box',
        },
        redirect:"/product/attr",
        children: [
          {
            path: '/product/attr',
            name: 'attr',
            component: () => import('@/views/product/attr/index.vue'),
            meta: {
              title: '商品属性',
              hidden: false,
              icon: 'el-Monitor',
            },
          },
          {
            path: '/product/brand',
            name: 'el-brand',
            component: () => import('@/views/product/brand/index.vue'),
            meta: {
              title: '品牌管理',
              hidden: false,
              icon: 'el-Ticket',
            },
          },
          {
            path: '/product/sku',
            name: 'sku',
            component: () => import('@/views/product/sku/index.vue'),
            meta: {
              title: 'SKU管理',
              hidden: false,
              icon: 'el-Paperclip',
            },
          },
          {
            path: '/product/spu',
            name: 'spu',
            component: () => import('@/views/product/spu/index.vue'),
            meta: {
              title: 'SPU管理',
              hidden: false,
              icon: 'el-MagicStick',
            },
          },
        ],
      },

    ]
  },


  {
    path: '/404',
    name: '404',
    component: () => import('@/views/404/index.vue'),
    meta: {
      title: '404',
      hidden: true,
    },
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index.vue'),
    meta: {
      title: 'any',
      hidden: true,
    },
  },
  {
    path: '/:pathMatch(.*)*',
    name: 'any',
    redirect: '/404',
    meta: {
      title: 'any',
      hidden: true,
    },
  },
]
